//
//  UIView+Frame.m
//  01-UIView、UIWindow
//
//  Created by 曹曹 on 16/7/14.
//  Copyright © 2016年 QC.L. All rights reserved.
//

#import "UIView+Frame.h"

@implementation UIView (Frame)
/** x */
- (void)setGx_x:(CGFloat)gx_x {
    CGRect rect = self.frame;
    rect.origin.x = gx_x;
    self.frame = rect;
}
- (CGFloat)gx_x {
    return self.frame.origin.x;
}
/** y */
- (void)setGx_y:(CGFloat)gx_y {
    CGRect rect = self.frame;
    rect.origin.y = gx_y;
    self.frame = rect;
}
- (CGFloat)gx_y {
    return self.frame.origin.y;
}
/** width */
- (void)setGx_width:(CGFloat)gx_width {
    CGRect rect = self.frame;
    rect.size.width = gx_width;
    self.frame = rect;
}
- (CGFloat)gx_width {
    return self.frame.size.width;
}
/** height */
- (void)setGx_height:(CGFloat)gx_height {
    CGRect rect = self.frame;
    rect.size.height = gx_height;
    self.frame = rect;
}
- (CGFloat)gx_height {
    return self.frame.size.height;
}
/** centerX */
- (void)setGx_centerX:(CGFloat)gx_centerX {
    CGPoint center = self.center;
    center.x = gx_centerX;
    self.center = center;
}
- (CGFloat)gx_centerX {
    return self.center.x;
}
/** centerY */
- (void)setGx_centerY:(CGFloat)gx_centerY {
    CGPoint center = self.center;
    center.y = gx_centerY;
    self.center = center;
}
- (CGFloat)gx_centerY {
    return self.center.y;
}

@end
